<?php 
if(!isset($galleryshowed))
{
    echo '<div id="PhotoShow" style="height:381px;width:580px;"></div>';
}
?>
<div class="Thumbsall">
    <div id="ppage"></div>
    <div class="PrevnAct" id="Prev" onclick="TrGallery.goFrame(-1)"></div>
    <div id="ThumbsDivall"></div>
    <div class="NextnAct" id="Next" onclick="TrGallery.goFrame(1)"></div>
    <div id="GDescription"></div>
</div>

<script type="text/javascript">    
<?php
foreach($listPhotos as $i=>$photo)
{
?>
TrGallery.addImg({f:"<?php echo GetIntroImg($photo['cImage'],true)?>",t:"<?php echo $photo['cName']?>"});
<?php
}
?>
TrGallery.init({dt: "ThumbsDivall",imginf: "6",rowt: "1",action: "<?php echo $galleryaction?>"});
</script>